<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>Crew Intranet: JMS</title>
            </f:facet>
        </h:head> 

        <h:body>
            <ui:composition template="./template.xhtml">
                <ui:define name="top">

                </ui:define>
                <ui:define name="left">
                    <h:form>
                        <p:menu my="true" style="width:200px">
                            <p:menuitem value="Configuration" action="#{redirectionBean.getRedirectionMigrationDBConfigACCESS}" 
                                        styleClass="#{view.viewId == '/migrationdbconfigaccess.xhtml'
                                                      ? 'ui-state-active menuItemSelectionner' : ''}"
                                        icon="ui-icon-home"/> 
                            <p:submenu label="Access" >  

                                <p:menuitem value="Transfer des données " action="#{redirectionBean.getRedirectionMigrationDBACCESS}" 
                                            styleClass="#{view.viewId == '/migrationdbaccess.xhtml'
                                                          ? 'ui-state-active menuItemSelectionner' : ''}"
                                            icon="ui-icon-star"/>  
                            </p:submenu>
                            <p:submenu label="Sql serveur">  

                                <p:menuitem value="Transfer des données" action="#{redirectionBean.getRedirectionAffectationsJMS}" icon="ui-icon-suitcase" />   
                            </p:submenu>    
                        </p:menu>
                    </h:form>
                </ui:define>
                <ui:define name="content">
                    <h:form id="formMessage">
                        <p:growl id="message" />
                        <p:growl id="messageGrow" showDetail="true" />
                    </h:form>
                    <h:form id="formeListBesoin">
                        <p:panel header="Employé" style="width: 95%">
                            <f:facet name="header">
                                Configuration pour ce connecter à la base <em>Access</em>
                            </f:facet>

                            <p:panel header="Base de donnée Access">

                                <p:panelGrid columns="2">
                                    <h:outputLabel value="Nom :" for="numDBAccess" />
                                    <p:inputText id="numDBAccess" value="#{migrationdbBean.cvConfigurationmigrationAccess.nom}" 
                                                 title="nom"  
                                                 disabled="true"
                                                 />


                                    <h:outputLabel value="Host :" for="hostDBAccess" />
                                    <p:panelGrid columns="4" id="hostDBAccess" >
                                        <p:inputMask value="#{migrationdbBean.elementIpAccess.p1}"
                                                     disabled="true"
                                                     style="width: 40px;"
                                                     mask="9?99" 
                                                     required="true" />
                                        <p:inputMask value="#{migrationdbBean.elementIpAccess.p2}"
                                                     disabled="true"
                                                     style="width: 40px;"
                                                     mask="9?99" 
                                                     required="true" />
                                        <p:inputMask value="#{migrationdbBean.elementIpAccess.p3}"
                                                     disabled="true"
                                                     style="width: 40px;"
                                                     mask="9?99" 
                                                     required="true" />
                                        <p:inputMask value="#{migrationdbBean.elementIpAccess.p4}"
                                                     disabled="true"
                                                     style="width: 40px;"
                                                     mask="9?99" 
                                                     required="true" />
                                    </p:panelGrid>

                                    <h:outputLabel value="Port :" for="portAccess" />
                                    <p:inputMask id="portAccess" value="#{migrationdbBean.cvConfigurationmigrationAccess.port}" 
                                                 mask="9?9999" 
                                                 style="width: 70px"
                                                 />

                                    <h:outputLabel value="Source de donnée :" for="sourceDeDonnee" />
                                    <p:inputText id="sourceDeDonnee" value="#{migrationdbBean.cvConfigurationmigrationAccess.sourcededonnee}" 
                                                 />

                                    <h:outputLabel value="User :" for="iserAccess" />
                                    <p:inputText id="iserAccess" value="#{migrationdbBean.cvConfigurationmigrationAccess.user}"  
                                                 />

                                    <h:outputLabel value="Password :" for="passwordAccess" />
                                    <p:password  id="passwordAccess" value="#{migrationdbBean.cvConfigurationmigrationAccess.password}" 
                                                 />
                                    <h:outputText />
                                    <h:panelGrid columns="2">
                                        <p:commandButton id="EnregistrerConfigAccess" 
                                                         update=":formMessage:message"
                                                         value="Enregistrer" icon="ui-icon-disk">
                                        </p:commandButton>
                                        <p:commandButton update=":formMessage:messageGrow"
                                                         action="#{migrationdbBean.testConnextionAvecLaBasseAccess}"
                                                         value="Tester" icon="ui-icon-arrowrefresh-1-w">
                                        </p:commandButton>
                                    </h:panelGrid>

                                </p:panelGrid>

                            </p:panel>
                            <p:separator id="customSeparator"  style="width:100%;height:5px" />
                            <p:panel header="Base de donnée SQL Server">

                                <p:panelGrid columns="2">
                                    <h:outputLabel value="Nom :" for="numDBSqlServer" />
                                    <p:inputText id="numDBSqlServer" value="#{migrationdbBean.cvConfigurationmigrationSqlServer.nom}" 
                                                 disabled="true"
                                                 title="nom"  required="true" />

                                    <h:outputLabel value="Host :" for="hostDBSqlServer" />
                                    <p:panelGrid columns="4" id="hostDBSqlServer">
                                        <p:inputMask value="#{migrationdbBean.elementIpSqlServer.p1}"
                                                     style="width: 40px;"
                                                     mask="9?99" 
                                                     required="true" />
                                        <p:inputMask value="#{migrationdbBean.elementIpSqlServer.p2}"
                                                     style="width: 40px;"
                                                     mask="9?99" 
                                                     required="true" />
                                        <p:inputMask value="#{migrationdbBean.elementIpSqlServer.p3}"
                                                     style="width: 40px;"
                                                     mask="9?99" 
                                                     required="true" />
                                        <p:inputMask value="#{migrationdbBean.elementIpSqlServer.p4}"
                                                     style="width: 40px;"
                                                     mask="9?99" 
                                                     required="true" />
                                    </p:panelGrid>

                                    <h:outputLabel value="Port :" for="portSQLserveur" />
                                    <p:inputMask id="portSQLserveur" value="#{migrationdbBean.cvConfigurationmigrationSqlServer.port}" 
                                                 mask="9?9999" 
                                                 style="width: 70px"
                                                 />

                                    <h:outputLabel value="Nom de la base :" for="sourceDeDonneeSQLserveur" />
                                    <p:inputText id="sourceDeDonneeSQLserveur" value="#{migrationdbBean.cvConfigurationmigrationSqlServer.sourcededonnee}" 

                                                 />

                                    <h:outputLabel value="User :" for="iserSqlServer" />
                                    <p:inputText id="iserSqlServer" value="#{migrationdbBean.cvConfigurationmigrationSqlServer.user}" 
                                                 required="true" />

                                    <h:outputLabel value="Password :" for="passwordSqlServer" />
                                    <p:password  id="passwordSqlServer" value="#{migrationdbBean.cvConfigurationmigrationSqlServer.password}" 
                                                 />
                                    <h:outputText />

                                    <h:panelGrid columns="2">
                                        <p:commandButton id="EnregistrerConfigSQLServer" 
                                                         update=":formMessage:messageGrow"
                                                         action="#{migrationdbBean.enregistrerConnextionAvecLaBasseSQLServer}"
                                                         value="Enregistrer" icon="ui-icon-disk">
                                        </p:commandButton>
                                        <p:commandButton update=":formMessage:messageGrow"
                                                         action="#{migrationdbBean.testConnextionAvecLaBasseSQLServer}"
                                                         value="Tester" icon="ui-icon-arrowrefresh-1-w">
                                        </p:commandButton>
                                    </h:panelGrid>
                                </p:panelGrid>

                            </p:panel>

                        </p:panel>
                    </h:form>
                </ui:define>
            </ui:composition>
        </h:body>

    </f:view>
</html>

